import { extendApi } from '@inbiz/utils';

export default extendApi(
  (
    _events,
    getTableData: (param: {
      page: number;
      pageSize: number;
      searchText: string;
      groupId?: string;
    }) => void,
    $activeGroupId: (a: string) => void,
    $edrmsparam: () => void,
    setDisable: (
      keys:
        | 'groupId'
        | 'mark'
        | 'name'
        | 'potentialStarterId'
        | 'pcPageKey'
        | 'pageKey'
        | 'sort'
        | 'descript',
    ) => void,
    setSponsor: (component: any) => void,
    setValue: (val: {
      groupId?: string;
      proLcon?: {
        type: string;
        color: string;
      };
      mark?: string;
      name?: string;
      potentialStarterId?: any;
      pcPageKey?: string;
      pageKey?: string;
      sort?: number;
      descript?: string;
    }) => void,
  ) => {
    return {
      loadListData: (param: {
        page: number;
        pageSize: number;
        searchText: string;
        groupId?: string;
      }) => {
        getTableData(param);
      },
      setActiveGroupId: $activeGroupId,
      setEdrmsparam: $edrmsparam,
      setEditFormValue: setValue,
      setEditFormDisable: setDisable,
      setSponsor,
    };
  },
);
